home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / Macintosh Tracker 1.20 / source / Tracker Client Folder / CDefaultVolume.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-18  |  840 b   |  46 lines  |  [TEXT/KAHL]

  1. /* CDefaultVolume.c */
  2.  
  3. #include "CDefaultVolume.h"
  4. #include "CMyDocument.h"
  5. #include "LocationConstants.h"
  6. #include "CWindow.h"
  7.  
  8. #define MINVolume (0)
  9. #define MAXVolume (255)
  10.  
  11.  
  12. void                CDefaultVolume::IDefaultVolume(CMyDocument* TheDocument,
  13.                             CWindow* TheWindow)
  14.     {
  15.         LongPoint            LocalStart,LocalExtent;
  16.  
  17.         Document = TheDocument;
  18.         GetRect(DefaultVolumeTEID,&LocalStart,&LocalExtent);
  19.         INumberText(LocalStart,LocalExtent,applFont,9,TheWindow,TheWindow);
  20.     }
  21.  
  22.  
  23. void                CDefaultVolume::StoreValue(void)
  24.     {
  25.         long            Temp;
  26.  
  27.         if (Dirty)
  28.             {
  29.                 Temp = GetValue();
  30.                 if (Temp < MINVolume)
  31.                     {
  32.                         Temp = MINVolume;
  33.                     }
  34.                 if (Temp > MAXVolume)
  35.                     {
  36.                         Temp = MAXVolume;
  37.                     }
  38.                 if (Temp != Document->Volume)
  39.                     {
  40.                         Document->SetDefaultVolume(Temp);
  41.                     }
  42.                 SetValue(Temp);
  43.             }
  44.         inherited::StoreValue();
  45.     }
  46.